package com.kaigejava.celue.patterns;

import com.kaigejava.celue.patterns.behaviorinterface.FlyBehavior;
import com.kaigejava.celue.patterns.behaviorinterface.QuackBehavior;
import lombok.Data;

/**
 * Created by kaigejava on 2019/8/9.
 */
@Data
public abstract class Duck {

    public  Duck(){}
    /**
     * 飞行行为
     */
     FlyBehavior myFlyBehavior;

     QuackBehavior myQuackBehavior;

    public void fly(){
        myFlyBehavior.fly();
    }

    public void quack(){
        myQuackBehavior.QuackBehavior();
    }

    public abstract void display();
}
